﻿<%@ Page Title="" Language="VB" MasterPageFile="~/Master/Site_InnerWeb.master" ValidateRequest="false"
    AutoEventWireup="false" CodeFile="MyCredit.aspx.vb" Inherits="private_secure_members_manage_MyCredit" %>
    <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="Server">
    <style type="text/css">
        .style1
        {
            width: 100%;
        }
        .style2
        {
            width: 91px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="Server">
    <h2>Manage My Credit</h2>
    <h3>Buy Your Credit Ready Yo Contact Your Customers</h3>
    <hr />
    <br />
    <table id="table1" class="style1">
        <tr>
            <td>
                <strong>Choose an Organisation/Business:</strong>
                <br />
                <asp:DropDownList ID="ddlEntity" runat="server" DataSourceID="SqlEntity_ds" DataTextField="Name"
                    DataValueField="ID" Width="250px" AutoPostBack="True" 
                    AppendDataBoundItems="True">
                    <asp:ListItem Value="0">Select Item from List</asp:ListItem>
                </asp:DropDownList>
                &nbsp;
                <asp:Button ID="btnBuyCredit" runat="server" Text="Buy Credits" /><br />
                <asp:SqlDataSource ID="SqlEntity_ds" runat="server" ConnectionString="<%$ ConnectionStrings:ApplicationServices %>"
                    SelectCommand="usp_GetEntityList_ByPersonId" 
                    SelectCommandType="StoredProcedure">
                    <SelectParameters>
                        <asp:Parameter Name="PersonId" Type="Int32" />
                    </SelectParameters>
                </asp:SqlDataSource>
            </td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
         <tr>
            <td valign="top">
                <asp:GridView ID="GridView1" runat="server" CellPadding="4" 
                    DataSourceID="EntityCredit_ds" ForeColor="#333333" 
                    AutoGenerateColumns="False" DataKeyNames="Id">
                    <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                    <Columns>
                        <asp:BoundField DataField="Id" HeaderText="Id" ReadOnly="True" 
                            SortExpression="Id" Visible="False" />
                        <asp:BoundField DataField="EntityId" HeaderText="EntityId" 
                            SortExpression="EntityId" Visible="False" />
                        <asp:BoundField DataField="Purchased" HeaderText="Credits Purchased" ReadOnly="True" 
                            SortExpression="Purchased" />
                        <asp:BoundField DataField="Used" HeaderText="Credits Used" ReadOnly="True" 
                            SortExpression="Used" />
                        <asp:BoundField DataField="Refunded" HeaderText="Credits Refunded" ReadOnly="True" 
                            SortExpression="Refunded" />
                        <asp:BoundField DataField="Balance" HeaderText="Credit Balance" ReadOnly="True" 
                            SortExpression="Balance" />
                    </Columns>
                    <EditRowStyle BackColor="#999999" />
                    <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                    <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                    <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                    <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                    <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                    <SortedAscendingCellStyle BackColor="#E9E7E2" />
                    <SortedAscendingHeaderStyle BackColor="#506C8C" />
                    <SortedDescendingCellStyle BackColor="#FFFDF8" />
                    <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
                </asp:GridView>
                <asp:SqlDataSource ID="EntityCredit_ds" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:ApplicationServices %>" 
                    DeleteCommand="pay.usp_EntityCreditDelete" DeleteCommandType="StoredProcedure" 
                    InsertCommand="pay.usp_EntityCreditInsert" InsertCommandType="StoredProcedure" 
                    SelectCommand="pay.usp_EntityCreditSelectByEntityId" 
                    SelectCommandType="StoredProcedure" UpdateCommand="pay.usp_EntityCreditUpdate" 
                    UpdateCommandType="StoredProcedure">
                    <DeleteParameters>
                        <asp:Parameter Name="Id" Type="Int32" />
                    </DeleteParameters>
                    <InsertParameters>
                        <asp:Parameter Name="Id" Type="Int32" />
                        <asp:Parameter Name="EntityId" Type="Int32" />
                        <asp:Parameter Name="Purchased" Type="Int32" />
                        <asp:Parameter Name="Used" Type="Int32" />
                        <asp:Parameter Name="Refunded" Type="Int32" />
                        <asp:Parameter Name="Balance" Type="Int32" />
                    </InsertParameters>
                    <SelectParameters>
                        <asp:ControlParameter ControlID="ddlEntity" Name="EntityId" 
                            PropertyName="SelectedValue" Type="Int32" />
                    </SelectParameters>
                    <UpdateParameters>
                        <asp:Parameter Name="Id" Type="Int32" />
                        <asp:Parameter Name="EntityId" Type="Int32" />
                        <asp:Parameter Name="Purchased" Type="Int32" />
                        <asp:Parameter Name="Used" Type="Int32" />
                        <asp:Parameter Name="Refunded" Type="Int32" />
                        <asp:Parameter Name="Balance" Type="Int32" />
                    </UpdateParameters>
                </asp:SqlDataSource>
                <br />
                <strong>Credit Usage for the Selected Organisation</strong><asp:GridView ID="GridView3" runat="server" CellPadding="4" ForeColor="#333333" 
                    AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" 
                    DataKeyNames="Id" DataSourceID="EntityCreditUsage_ds">
                    <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                    <Columns>
                        <asp:BoundField DataField="Id" HeaderText="Id" ReadOnly="True" 
                            SortExpression="Id" Visible="False" />
                        <asp:BoundField DataField="EntityId" HeaderText="EntityId" 
                            SortExpression="EntityId" Visible="False" />
                        <asp:BoundField DataField="PersonId" HeaderText="PersonId" 
                            SortExpression="PersonId" Visible="False" />
                        <asp:BoundField DataField="RecipientsCount" HeaderText="Recipients Count" 
                            SortExpression="RecipientsCount" />
                        <asp:BoundField DataField="MessagesCount" HeaderText="Messages Count" 
                            SortExpression="MessagesCount" />
                        <asp:BoundField DataField="DisplayName" HeaderText="Display Name" 
                            SortExpression="DisplayName" />
                    </Columns>
                    <EditRowStyle BackColor="#999999" />
                    <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                    <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                    <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                    <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                    <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                    <SortedAscendingCellStyle BackColor="#E9E7E2" />
                    <SortedAscendingHeaderStyle BackColor="#506C8C" />
                    <SortedDescendingCellStyle BackColor="#FFFDF8" />
                    <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
                </asp:GridView>
                <asp:SqlDataSource ID="EntityCreditUsage_ds" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:ApplicationServices %>" 
                    DeleteCommand="pay.usp_EntityCreditUsageDelete" DeleteCommandType="StoredProcedure" 
                    InsertCommand="pay.usp_EntityCreditUsageInsert" InsertCommandType="StoredProcedure" 
                    SelectCommand="pay.usp_EntityCreditUsageSelectByEntityId" 
                    SelectCommandType="StoredProcedure" UpdateCommand="pay.usp_EntityCreditUsageUpdate" 
                    UpdateCommandType="StoredProcedure">
                    <DeleteParameters>
                        <asp:Parameter Name="Id" Type="Int32" />
                    </DeleteParameters>
                    <InsertParameters>
                        <asp:Parameter Name="Id" Type="Int32" />
                        <asp:Parameter Name="EntityId" Type="Int32" />
                        <asp:Parameter Name="PersonId" Type="Int32" />
                        <asp:Parameter Name="RecipientsCount" Type="Int32" />
                        <asp:Parameter Name="MessagesCount" Type="Int32" />
                    </InsertParameters>
                    <SelectParameters>
                        <asp:ControlParameter ControlID="ddlEntity" Name="EntityId" 
                            PropertyName="SelectedValue" Type="Int32" />
                    </SelectParameters>
                    <UpdateParameters>
                        <asp:Parameter Name="Id" Type="Int32" />
                        <asp:Parameter Name="EntityId" Type="Int32" />
                        <asp:Parameter Name="PersonId" Type="Int32" />
                        <asp:Parameter Name="RecipientsCount" Type="Int32" />
                        <asp:Parameter Name="MessagesCount" Type="Int32" />
                    </UpdateParameters>
                </asp:SqlDataSource>
                <br />
             </td>
            <td>
                &nbsp;</td>
            <td valign="top">
                <strong>Credit Purchase(s) for the Selected Organisation</strong></td>
        </tr>
         <tr>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
         <tr>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
         <tr>
            <td valign="top">
                <asp:RadioButtonList ID="RadioButtonList1" runat="server">
                    <asp:ListItem>10 Credits</asp:ListItem>
                    <asp:ListItem>20 Credits</asp:ListItem>
                    <asp:ListItem>50 Credits</asp:ListItem>
                    <asp:ListItem>100 Credits</asp:ListItem>
                    <asp:ListItem>150 Credits</asp:ListItem>
                    <asp:ListItem>200 Credits</asp:ListItem>
                    <asp:ListItem>250 Credits</asp:ListItem>
                    <asp:ListItem>500 Credits</asp:ListItem>
                    <asp:ListItem>750 Credits</asp:ListItem>
                    <asp:ListItem>1000 Credits</asp:ListItem>
                </asp:RadioButtonList>
                <asp:Button ID="Button1" runat="server" Text="Buy Now" />
                <br />
                <br />
                <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
                <ContentTemplate>

                <asp:CheckBoxList ID="CheckBoxList1" runat="server" AutoPostBack="True">
                    <asp:ListItem Value="10">10 Credits</asp:ListItem>
                    <asp:ListItem Value="20">20 Credits</asp:ListItem>
                    <asp:ListItem Value="50">50 Credits</asp:ListItem>
                    <asp:ListItem Value="100">100 Credits</asp:ListItem>
                    <asp:ListItem Value="150">150 Credits</asp:ListItem>
                    <asp:ListItem Value="200">200 Credits</asp:ListItem>
                    <asp:ListItem Value="250">250 Credits</asp:ListItem>
                    <asp:ListItem Value="500">500 Credits</asp:ListItem>
                    <asp:ListItem Value="750">750 Credits</asp:ListItem>
                    <asp:ListItem Value="1000">1000 Credits</asp:ListItem>
                </asp:CheckBoxList>
                <asp:Label ID="lblSum" runat="server" Text="0"></asp:Label>
                </ContentTemplate>
                </asp:UpdatePanel>
                <br />
                <asp:Button ID="Button2" runat="server" Text="Buy Now" />
                <br />
                <asp:Label ID="Label9" runat="server" Text=""></asp:Label>
                <br />
             </td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
         <tr>
            <td>
    <asp:Panel ID="Panel2" runat="server"  CssClass="modalPopup">
        <%--                <input id="btnCancel" type="button" value="X" Style="display: none" style="float: right; background-color: #FF0000;" />
        --%>
        <asp:Button ID="Button3" runat="server" CausesValidation="false" Text="X" Style="float: right;
            background-color: #FF0000;" />
        <h2>
            <asp:Label ID="Label8" runat="server" Text="PopUp Heading3"></asp:Label></h2>
        <asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
        <table style="width: 100%;">
            <tr>
                <td valign="top">
                    <asp:Label ID="Label7" runat="server" Text=""></asp:Label>
                    <br />
                    <table style="width:100%;">
                        <tr>
                            <td class="style2">
                                <asp:Label ID="Label5" runat="server" Text="Card Type:"></asp:Label>
                            </td>
                            <td>
                                <asp:DropDownList ID="cboCCType" runat="server" AutoPostBack="True">
                                    <asp:ListItem Value="1">Visa</asp:ListItem>
                                    <asp:ListItem Value="2">Mastercard</asp:ListItem>
                                </asp:DropDownList>
                            </td>
                            <td>
                                &nbsp;</td>
                        </tr>
                        <tr>
                            <td class="style2">
                                <asp:Label ID="Label6" runat="server" Text="Expiry Date:"></asp:Label>
                            </td>
                            <td valign="middle">
                                mm
                                <asp:DropDownList ID="cboCardExpiryMM" runat="server">
                                    <asp:ListItem Value="1">1</asp:ListItem>
                                    <asp:ListItem Value="2">2</asp:ListItem>
                                    <asp:ListItem Value="3"></asp:ListItem>
                                    <asp:ListItem Value="4"></asp:ListItem>
                                    <asp:ListItem Value="5">5</asp:ListItem>
                                    <asp:ListItem Value="6">6</asp:ListItem>
                                    <asp:ListItem Value="7">7</asp:ListItem>
                                    <asp:ListItem Value="8">8</asp:ListItem>
                                    <asp:ListItem Value="09">9</asp:ListItem>
                                    <asp:ListItem Value="10">10</asp:ListItem>
                                    <asp:ListItem Value="11">11</asp:ListItem>
                                    <asp:ListItem Value="12">12</asp:ListItem>
                                </asp:DropDownList>
                                &nbsp;yy <asp:DropDownList ID="cboCardExpiryYY" runat="server">
                                    <asp:ListItem>13</asp:ListItem>
                                    <asp:ListItem>14</asp:ListItem>
                                    <asp:ListItem>15</asp:ListItem>
                                    <asp:ListItem>16</asp:ListItem>
                                    <asp:ListItem>17</asp:ListItem>
                                    <asp:ListItem>18</asp:ListItem>
                                    <asp:ListItem>19</asp:ListItem>
                                    <asp:ListItem>20</asp:ListItem>
                                </asp:DropDownList>
                            </td>
                            <td>
                                &nbsp;</td>
                        </tr>
                        <tr>
                            <td class="style2">
                                <asp:Label ID="Label4" runat="server" Text="Card Number:"></asp:Label>
                            </td>
                            <td>
                                <asp:TextBox ID="txtCardNumber" runat="server" Width="80%"></asp:TextBox>
                            </td>
                            <td>
                                &nbsp;</td>
                        </tr>
                        <tr>
                            <td class="style2">
                                <asp:Label ID="Label2" runat="server" Text="ExpDate:"></asp:Label>
                            </td>
                            <td>
                                <asp:TextBox ID="ExpDateTxtBox" runat="server"></asp:TextBox>
                            </td>
                            <td>
                                &nbsp;</td>
                        </tr>
                        <tr>
                            <td class="style2">
                                <asp:Label ID="Label3" runat="server" Text="CCV:"></asp:Label>
                            </td>
                            <td>
                                <asp:TextBox ID="txtCVV" runat="server"></asp:TextBox>
                            </td>
                            <td>
                                &nbsp;</td>
                        </tr>
                        <tr>
                            <td class="style2">
                                &nbsp;&nbsp;</td>
                            <td>
                                <asp:Button ID="Button7" runat="server" Text="Pay" />
                            </td>
                            <td>
                                </td>
                        </tr>
                        <tr>
                            <td>
                                &nbsp;</td>
                            <td>
                                <asp:Label ID="MsgLbl" runat="server" Text=""></asp:Label>
                            </td>
                            <td>
                                &nbsp;</td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
        </ContentTemplate>
        </asp:UpdatePanel>
        <asp:Button ID="Button6" runat="server" Text="Button" Style="display: none;" />
        <asp:ModalPopupExtender ID="ModalPopupExtender2" runat="server" PopupControlID="Panel2"
            DynamicServicePath="" Enabled="True" TargetControlID="Button6" BackgroundCssClass="modalBackground"
            DropShadow="true">
        </asp:ModalPopupExtender>
    </asp:Panel>
             </td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
    </table>

</asp:Content>
